#include<stdio.h>

#define OFFSETOF(type,name)   (int)&(((type*)0)->name)

struct s
{
    char a;
    int i;
    char b;
};

int main()
{
  printf("%d\n",OFFSETOF(struct s,a));
  printf("%d\n",OFFSETOF(struct s,i));
  printf("%d\n",OFFSETOF(struct s,b));
}